﻿package plugin.bagN
{
    import com.core.*;
    import manager.*;
    import plugin.roleN.model.*;

    public class BagControl extends Control
    {

        public function BagControl(param1:Object)
        {
            super(param1);
            return;
        }// end function

        public function open() : void
        {
            return;
        }// end function

        public function close() : void
        {
            return;
        }// end function

        override public function update(param1:Obproxy, param2:ProxyChange) : void
        {
            var _loc_3:Boolean = false;
            if (param1.getName() == "bag")
            {
                if (param2.property == "init")
                {
                    this.target.init(param2.newvalue);
                }
                else if (param2.property == "chushou")
                {
                    this.target.chushou();
                }
                else if (param2.property == "changetype")
                {
                    this.target.tabHandler(param2.newvalue);
                }
                else if (param2.property == "clickitem")
                {
                    this.target.clickitem(param2.newvalue.p, param2.newvalue.data);
                }
                else if (param2.property == "clickitem2")
                {
                    this.target.clickitem2(param2.newvalue.data);
                }
                else if (param2.property == "money")
                {
                    this.target.updateCost(3, param2.newvalue);
                }
                else if (param2.property == "removeitem")
                {
                    this.target.changeItemByIndex(param2.newvalue[0], param2.newvalue[1]);
                }
                else if (param2.property == "bonus")
                {
                    this.target.updateCost(2, param2.newvalue);
                }
                else if (param2.property == "glod")
                {
                    this.target.updateCost(1, param2.newvalue);
                }
                else if (param2.property == "dragComplate")
                {
                    this.target.DragOver(param2.newvalue.data, param2.newvalue.point, param2.newvalue.key);
                }
                else if (param2.property == "swap")
                {
                    this.target.swapList(param2.newvalue);
                }
                else if (param2.property == "giveup")
                {
                    this.target.changeItemByIndex(param2.newvalue, null);
                }
                else if (param2.property == "putinItem")
                {
                    this.target.changeItemByIndex(param2.newvalue[0], param2.newvalue[1]);
                }
                else if (param2.property == "kuorong")
                {
                    this.target.kuorong(param2.newvalue);
                }
                else if (param2.property == "throw")
                {
                    this.target.throwByIndex(param2.newvalue);
                }
                else if (param2.property == "tidyItem")
                {
                    this.target.tidyItem(param2.newvalue);
                }
                else if (param2.property == "sellItem")
                {
                    this.target.sellItem(param2.newvalue);
                }
                else if (param2.property == "sellback")
                {
                    this.target.sellback(param2.newvalue);
                }
                else if (param2.property == "addItem")
                {
                    this.target.addItem(param2.newvalue);
                }
                else if (param2.property == "putOn")
                {
                    _loc_3 = ModelProxy.getValue("data", "qhflag");
                    if (_loc_3)
                    {
                        ModelProxy.change("movetips", "error", "强化中不能穿戴装备");
                        return;
                    }
                    PluginManager.instance.sendToServer("role", CMDRole.PutOn, param2.newvalue);
                }
                else if (param2.property == "durables")
                {
                    this.target.UpdateDurables(param2.newvalue);
                }
                else if (param2.property == "updatelocal")
                {
                    this.target.Localupdate();
                }
                else if (param2.property == "toolstartcd")
                {
                    this.target.toolStartCd(param2.newvalue);
                }
                else if (param2.property == "updateopentime")
                {
                    this.target.updateopentime();
                }
                else if (param2.property == "closemenue")
                {
                    this.target.closemenue();
                }
                else if (param2.property == "closesell")
                {
                    this.target.closeComplete();
                }
                else if (param2.property == "businessAddItem")
                {
                    this.target.businessAddItem(param2.newvalue);
                }
                else if (param2.property == "vip")
                {
                    this.target.getVip();
                }
                else if (param2.property == "closepanel")
                {
                    this.target.closePanel();
                }
            }
            return;
        }// end function

    }
}
